<link href="__PUBLIC__/plugins/fitui/tablegrid.css" rel="stylesheet">
<link href="__PUBLIC__/plugins/bootstrap-datetimepicker/bootstrap-datetimepicker.min.css" rel="stylesheet">
<link href="__PUBLIC__/plugins/huploadify/Huploadify.css" rel="stylesheet">
<script src="__PUBLIC__/plugins/bootstrap-datetimepicker/bootstrap-datetimepicker.min.js"></script>
<script src="__PUBLIC__/plugins/bootstrap-datetimepicker/bootstrap-datetimepicker.zh-CN.js"></script>
<script src="__PUBLIC__/plugins/huploadify/jquery.Huploadify.js"></script>
<script src="__PUBLIC__/plugins/kindeditor-4.1.10/kindeditor-all-min.js"></script>
<script src="__PUBLIC__/plugins/kindeditor-4.1.10/lang/zh_CN.js"></script>
<script src="__PUBLIC__/js/mp/format.js"></script>
<script src="__PUBLIC__/plugins/fitui/tablegrid.js"></script>
<script src="__PUBLIC__/js/mp/wx_event_treasure.js"></script>
<script>
var Param = <?php echo json_encode( $param ) ?> ;
$(function(){
  WxEventTreasure.init(<?php echo json_encode( $config ) ?>);
});

</script>

<div class="page-content">
  <ol class="breadcrumb">
    <li><a href="<?php echo $home_url ?>">首页</a></li>
    <li class="active"><?php echo $module_name ?></li>
  </ol>
  <div class="page-content-inner"> 
    <!-- read_modal -->
    <div class="portlet blue" id="read_modal"> 
      <!-- portlet-title -->
      <div class="portlet-title">
        <div class="caption"> <i class="fa fa-comments "></i> <?php echo $module_name ?> </div>
        <div class="tools">
          <?php if ( $opt_data == 1 || in_array( '添加' , $opt_data ) ) : ?>
          <a href="#" class="toolbtn add load_add_modal_btn" data-toggle="tooltip" data-placement="top" title="新增"></a>
          <?php endif ; ?>
        </div>
      </div>
      <!-- end portlet-title -->
      <div class="portlet-body "> 
        <!-- table grid -->
        <div class="table-responsive">
          <table id="data_table" class="table table-striped table-hover table-condensed">
            <thead>
              <tr>
                <th width="80" data-field="id"  >ID</th>
                <th width="300" data-field="name">活动名称</th>
                <th width="80" data-field="inc_point_rate">好人卡</th>
                <th width="80" data-field="dec_point_rate">地雷卡</th>
                <th width="120" data-field="start_time"  >开始时间</th>
                <th width="120" data-field="end_time"  >结束时间</th>
                <?php if ( $opt_data == 1 || in_array( '编辑' , $opt_data ) ) : ?>
                <th width="80" data-formatter="opt_edit"></th>
                <?php endif ; ?>
                <?php if ( $opt_data == 1 || in_array( '删除' , $opt_data ) ) : ?>
                <th width="80" data-formatter="opt_delete"></th>
                <?php endif ; ?>
                <th width="80" data-formatter="opt_more"></th>
                <th>&nbsp;</th>
              </tr>
            </thead>
          </table>
        </div>
        <!-- end table --> 
        <div class="row" style="text-align:center; margin-top:60px;">
          <button type="button" class="btn btn-lg btn-default" onClick="javascript:history.go(-1)"><i class="fa fa-arrow-left"></i> 返回</button>
        </div>
      </div>
    </div>
    <!-- end portlet read_modal --> 
    
    <!-- add_edit_modal  -->
    <div class="portlet" id="add_edit_modal" style="display:none;">
      <div class="portlet-title">
        <div class="caption"> <i class="fa fa-cogs"></i> <span id="action_label"></span> <?php echo $module_name ?> </div>
      </div>
      <div class="portlet-body ">
        <form id="submit_form" class="form-horizontal">
          <div class="form-group">
            <label class="col-sm-3 control-label">活动名称</label>
            <div class="col-sm-7">
              <input name="name" placeholder="活动名称" data-valid="required" data-tips="请填写正确的活动名称" type="text" class="form-control" >
            </div>
          </div>
          <div class="form-group">
            <label class="col-sm-3 control-label">图标</label>
            <div class="col-sm-7">
              <div id="icon_preview" class="img-preview"></div>
              <div id="icon_upload_btn"></div>
              <input name="icon" placeholder="活动图标" type="hidden" class="form-control" >
            </div>
          </div>
          <div class="form-group">
            <label class="col-sm-3 control-label">分享描述</label>
            <div class="col-sm-7">
              <input name="share_desc" placeholder="分享描述"  type="text" class="form-control" >
            </div>
          </div>
          <div class="form-group">
            <label class="col-sm-3 control-label">规则</label>
            <div class="col-sm-7">
              <textarea name="rule" placeholder="活动规则" class="form-control" id="editor" style="width:100%" ></textarea>
            </div>
          </div>
          <div class="form-group">
            <label class="col-sm-3 control-label">分享链接</label>
            <div class="col-sm-7">
              <input name="share_url" placeholder="分享链接" type="text" class="form-control" >
            </div>
          </div>
          <div class="form-group">
            <label class="col-sm-3 control-label">时间</label>
            <div class="col-sm-2">
              <input name="start_time" placeholder="开始时间" data-valid="required" data-tips="请填写正确的开始时间" type="text" class="form-control dtp" >
            </div>
            <div class="col-sm-2">
              <input name="end_time" placeholder="结束时间" data-valid="required" data-tips="请填写正确的结束时间" type="text" class="form-control dtp" >
            </div>
          </div>

          <div class="form-group">
            <label class="col-sm-3 control-label">初始用户元宝</label>
            <div class="col-sm-2">
              <input name="init_min_point" placeholder="初始用户最小元宝" data-valid="number" data-tips="请填写正确的初始用户最小元宝" type="text" class="form-control" >
            </div>
            <div class="col-sm-2">
              <input name="init_max_point" placeholder="初始用户最大元宝" data-valid="number" data-tips="请填写正确的初始用户最大元宝" type="text" class="form-control" >
            </div> 
            <div class="col-sm-5">最小-最大</div>
          </div>
          
          <div class="form-group">
            <label class="col-sm-3 control-label">作弊阀值</label>
            <div class="col-sm-2">
              <input name="threshold" placeholder="作弊阀值" data-valid="number" data-tips="请填写正确的作弊阀值" type="text" class="form-control" >
            </div>
          </div>
          
          <div class="form-group">
            <label class="col-sm-3 control-label">好人卡几率(< 阀值)</label>
            <div class="col-sm-2">
              <input name="inc_point_rate" placeholder="好人卡几率" data-valid="number" data-tips="请填写正确的好人卡几率" type="text" class="form-control" >
            </div>
            <div class="col-sm-5">%</div>
          </div>

          <div class="form-group">
            <label class="col-sm-3 control-label">好人卡得分</label>
            <div class="col-sm-2">
              <input name="inc_min_point" placeholder="好人卡最小得分" data-valid="number" data-tips="请填写正确的好人卡最小得分" type="text" class="form-control" >
            </div>
            <div class="col-sm-2">
              <input name="inc_max_point" placeholder="好人卡最大得分" data-valid="number" data-tips="请填写正确的好人卡最小得分" type="text" class="form-control" >
            </div>
            <div class="col-sm-5">最小-最大</div>
          </div>
          <div class="form-group">
            <label class="col-sm-3 control-label">地雷卡几率( > 阀值)</label>
            <div class="col-sm-2">
              <input name="dec_point_rate" placeholder="地雷卡几率" data-valid="number" data-tips="请填写正确的地雷卡几率" type="text" class="form-control" >
            </div>
            <div class="col-sm-5">%</div>
          </div>
          <div class="form-group">
            <label class="col-sm-3 control-label">地雷卡得分</label>
            <div class="col-sm-2">
              <input name="dec_min_point" placeholder="好人卡最小得分" data-valid="number" data-tips="请填写正确的好人卡最小得分" type="text" class="form-control" >
            </div>
            <div class="col-sm-2">
              <input name="dec_max_point" placeholder="好人卡最大得分" data-valid="number" data-tips="请填写正确的好人卡最小得分" type="text" class="form-control" >
            </div>
            <div class="col-sm-5">最小-最大</div>
          </div>
          <hr>
          <div class="row">
            <div class="col-md-12" style="text-align:center">
              <button class="btn btn-default btn-lg " id="add_edit_close_btn" type="button"><i class="fa fa-arrow-left"></i> 返回</button>
              <button class="btn btn-danger btn-lg " id="submit_btn" type="button"><i class="fa fa-edit"></i> 提交</button>
            </div>
          </div>
        </form>
      </div>
    </div>
    <!-- end portlet add_edit_modal --> 
  </div>
  <!-- end page-content-inner --> 
</div>
